home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-08-12 | 18.4 KB | 445 lines | [TEXT/MPS ] |
- //
- // User Interface Example.r - demonstrates User Interface of the Installer
- //
- //
- // This example demonstrates usage of the following functionality:
- // - Custom install framework to create custom feature hierarchy
- // - Presentation of multiple easy feature sets
- // - Installation of files
- // - Use of the latest script resources
- //
- // Copyright 1993-1998, Apple Computer, Inc., All Rights Reserved
- //
-
- #include "Types.r"
- #include "InstallerTypes.r"
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // • Installer Version Resource
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- // This way the Installer script can only be opened by Installer Engine 4.5 and later.
- resource 'invs' (1) {
- format0 {
- 0x04, 0x50, 0x80, 0x00,
- "4.5"
- }
- };
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // • Installer Preference Resource
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- resource 'inpr' (300) {
- format1 {
- useDiskTargetMode, // User chooses an entire disk as the destination.
- noSetupFunctionSupplied, // Not using a setup function code resource
- dontAllowCleanInstall, // Clean install is only appropriate when installing Apple System Software
- isNotSSWInstallation, // We're not installing System Software
- '', // Setup function type, but we don't have one so it's zero
- 0, // Setup function ID, but we don't have one so it's zero
- 0, // Text Encoding ID of product's localized language, 0 for U.S.
- 1000, // ID of 'STR#' resource to store feature set names
- {
- 1000, 1, // Recommended Feature Set (Feature set rule framework ID and string index of feature set name)
- 1001, 2, // Full Feature Set
- 1002, 3, // Minimal Feature Set
- },
- "" // Default target folder name. Not needed for disk mode.
- }
- };
-
- resource 'STR#' (1000) {
- {
- /* [1] */ "Recommended Installation",
- /* [2] */ "Full Installation",
- /* [3] */ "Minimal Installation",
- }
- };
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // • Custom Install Feature List
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- // We want the feature hierarchy to look like this:
- // Feature ID ('inpk' ID) Removable
- // [] Feature #1 (i) 1001 Yes
- // [] Feature #2 (i) 1002 No
- // ------------------------------- 9999 -
- // [] More Features 1003 Partial
- // [] Feature #3 2001 Yes
- // [] Even More Features 2002 Partial
- // [] Feature #4 3001 No
- // [] Feature #5 3002 Yes
- // [] Feature #6 1004 No
- // [] Feature #7 1005 Yes
- //
-
- // custom install framework always uses ID of 766
- resource 'infr' (766) {
- format0 {{
- pickFirst, { 800 },
- }}
- };
-
- // rule that adds main package to Custom Install
- resource 'inrl' (800) {
- format0 {{
- // add main package to Custom Install package list
- AddCustomItems{{ 1001, 1002, 9999, 1003, 1004, 1005 }},
- }}
- };
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // • Feature Set Resources (easy install frameworks)
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- // Recommended Feature Set
- resource 'infr' (1000) {
- format0 {{
- pickFirst, { 1000 },
- }}
- };
-
- // Rule that specifies Recommended Feature Set
- resource 'inrl' (1000) {
- format0 {{
- // add main package and description to Easy Install package list
- AddPackages{{ 1001, 2001, 3002, 1005 }},
- AddUserDescription{ "Click Start to install the recommended software onto “^0”." },
- }}
- };
-
- // Full Feature Set
- resource 'infr' (1001) {
- format0 {{
- pickFirst, { 1001 },
- }}
- };
-
- // Rule that specifies Full Feature Set
- resource 'inrl' (1001) {
- format0 {{
- // add main package and description to Easy Install package list
- AddPackages{{ 1001, 1002, 1003, 1004, 1005 }},
- AddUserDescription{ "Click Start to install all software onto “^0”." },
- }}
- };
-
- // Minimal Feature Set
- resource 'infr' (1002) {
- format0 {{
- pickFirst, { 1002 },
- }}
- };
-
- // Rule that specifies Minimal Feature Set
- resource 'inrl' (1002) {
- format0 {{
- // add main package and description to Easy Install package list
- AddPackages{{ 1001, 3002 }},
- AddUserDescription{ "Click Start to install a minimal set of software onto “^0”." },
- }}
- };
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // • Features (packages)
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- resource 'inpk' (1001) {
- format0 {
- showsOnCustom, // show the package as a selectable item
- // item when used as a subpackage
-
- removable, // show under Custom Remove as a selectable
- // item, when package is a subpackage
-
- dontForceRestart, // don't make user reboot after installation
-
- 1001, // package comments resource ID
-
- 0, // package size ( if 0, filled by ScriptCheck )
-
- "Feature #1", // Custom Install selection description
- {
- 'infa', 1001; // file to install or remove
- },
- }
- };
-
- resource 'inpk' ( 1002 ) { format0 { showsOnCustom, notRemovable, dontForceRestart, 1002, 0, "Feature #2", { 'infa', 1002 }, } };
- resource 'inpk' ( 9999 ) { format0 { showsOnCustom, notRemovable, dontForceRestart, 0, 0, "-", {}, } };
- resource 'inpk' ( 1003 ) { format0 { showsOnCustom, removable, dontForceRestart, 0, 0, "More Features", { 'inpk', 2001,'inpk', 2002 }, } };
- resource 'inpk' ( 2001 ) { format0 { showsOnCustom, removable, dontForceRestart, 0, 0, "Feature #3", { 'infa', 2001 }, } };
- resource 'inpk' ( 2002 ) { format0 { showsOnCustom, removable, dontForceRestart, 0, 0, "Even More Features", { 'inpk', 3001,'inpk', 3002 }, } };
- resource 'inpk' ( 3001 ) { format0 { showsOnCustom, notRemovable, dontForceRestart, 0, 0, "Feature #4", { 'infa', 3001 }, } };
- resource 'inpk' ( 3002 ) { format0 { showsOnCustom, removable, dontForceRestart, 0, 0, "Feature #5", { 'infa', 3002 }, } };
- resource 'inpk' ( 1004 ) { format0 { showsOnCustom, notRemovable, dontForceRestart, 0, 0, "Feature #6", { 'infa', 1004 }, } };
- resource 'inpk' ( 1005 ) { format0 { showsOnCustom, removable, dontForceRestart, 0, 0, "Feature #7", { 'infa', 1005 }, } };
-
-
-
- // • package comments
-
- // NOTE: The actual file that will be installed by each package is a SimpleText file
- // named Example File. The information detailed below does not actually correspond to
- // the file being installed and is intended only as an example of how to
- // prepare custom package information resources.
-
- // FURTHER NOTE: The values that are assigned to the Custom Package Information
- // resource fields do not actually have any effect on the installation and
- // are ignored during installation. They can however assist the user in
- // choosing which packages they would like to include in their Custom
- // Installation or Custom Removal.
-
-
- resource 'inpc' ( 1001 ) {
- format1 {
- 0, // sample date ( 08/08/94 seconds since 1904)
- 0x08018000, // sample version ( 8.0.1 GM)
-
- 0, // Ignored, not shown in user interface
-
- 9128, // icon resource ID ( 'ICN#', 'icl4', 'icl8' )
- // - ID must be greater than 1024
- // - resource item is in included rsrc file
-
- 1001 // 'TEXT' resource ID of item containing package description
- }
- };
-
- resource 'inpc' ( 1002 ) { format1 { 0, 0, 0, 9128, 1002 } };
-
- data 'TEXT' ( 1001 ) { "This feature installs 'Example File • 1'." };
- data 'TEXT' ( 1002 ) { "This feature installs 'Example File • 2'." };
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // • File Copy Commands
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- resource 'ifa#' (300) {
- format0 {
- { /* [1] */ 1001, // Unique ID of this File Atom
- deleteWhenRemoving, // Delete file on removal
- deleteWhenInstalling, // Doesn't matter since we're copying
- copy, // Copy file during installation
- dontIgnoreLockedFile, // Warn user if file is locked
- dontSetFileLocked, // Leave file unlocked after installation
- useVersProcToCompare, // Compare newness of file based on 'vers' resource
- srcNeedExist, // File must exist on source disk
- rsrcForkInRsrcFork, // File isn't compressed so rsrc fork is in rsrc fork
- leaveAloneIfNewer, // Don't update an existing newer file
- updateExisting, // Go ahead an update if appropriate
- copyIfNewOrUpdate, // Go ahead and create a new file when necessary
- rsrcFork, // Copy the resource fork, if any
- dataFork, // Copy the data fork, if any
- 0, // Total file size, filled in by ScriptCheck
- 0, // Finder attributes, filled in by ScriptCheck
- 1001, // Reference to target file specification
- 1001, // Reference to source file specification
- 0, // Exact target data fork size, filled in by ScriptCheck
- 0, // Exact target resource fork size, filled in by ScriptCheck
- 0, // Source version number, filled in by ScriptCheck
- 0, // Compare versions using built-in compare proc.
- 0, // No atom extender since we're not copying compressed data
- /* [2] */ 1002, deleteWhenRemoving, deleteWhenInstalling, copy, dontIgnoreLockedFile, dontSetFileLocked, useVersProcToCompare, srcNeedExist, rsrcForkInRsrcFork, leaveAloneIfNewer, updateExisting, copyIfNewOrUpdate, rsrcFork, dataFork, 0, 0, 1002, 1002, 0, 0, 0, 0, 0,
- /* [3] */ 2001, deleteWhenRemoving, deleteWhenInstalling, copy, dontIgnoreLockedFile, dontSetFileLocked, useVersProcToCompare, srcNeedExist, rsrcForkInRsrcFork, leaveAloneIfNewer, updateExisting, copyIfNewOrUpdate, rsrcFork, dataFork, 0, 0, 2001, 2001, 0, 0, 0, 0, 0,
- /* [4] */ 3001, deleteWhenRemoving, deleteWhenInstalling, copy, dontIgnoreLockedFile, dontSetFileLocked, useVersProcToCompare, srcNeedExist, rsrcForkInRsrcFork, leaveAloneIfNewer, updateExisting, copyIfNewOrUpdate, rsrcFork, dataFork, 0, 0, 3001, 3001, 0, 0, 0, 0, 0,
- /* [5] */ 3002, deleteWhenRemoving, deleteWhenInstalling, copy, dontIgnoreLockedFile, dontSetFileLocked, useVersProcToCompare, srcNeedExist, rsrcForkInRsrcFork, leaveAloneIfNewer, updateExisting, copyIfNewOrUpdate, rsrcFork, dataFork, 0, 0, 3002, 3002, 0, 0, 0, 0, 0,
- /* [6] */ 1004, deleteWhenRemoving, deleteWhenInstalling, copy, dontIgnoreLockedFile, dontSetFileLocked, useVersProcToCompare, srcNeedExist, rsrcForkInRsrcFork, leaveAloneIfNewer, updateExisting, copyIfNewOrUpdate, rsrcFork, dataFork, 0, 0, 1004, 1004, 0, 0, 0, 0, 0,
- /* [7] */ 1005, deleteWhenRemoving, deleteWhenInstalling, copy, dontIgnoreLockedFile, dontSetFileLocked, useVersProcToCompare, srcNeedExist, rsrcForkInRsrcFork, leaveAloneIfNewer, updateExisting, copyIfNewOrUpdate, rsrcFork, dataFork, 0, 0, 1005, 1005, 0, 0, 0, 0, 0,
- }
- }
- };
-
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // • Target File Descriptions
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
- resource 'itf#' (300) {
- format0 {
- 300, // ID of 'ist#' resource that contains path names.
- {
- /* [1] */ 1001, // Unique ID of this target file specification
- noSearchForFile, // We don't need to search for the target file
- TypeCrNeedNotMatch, // We don't care what the existing type and creator are
- 'ttro', // Type given to the file
- 'ttxt', // Creator given to the file
- 0x0, // Finder flags given to the file,filled in by ScriptCheck
- 0x1, // Creation date given to the file, value of 1 specifies that ScriptCheck should update this value
- 0x1, // Modification date given to the file, value of 1 specifies that ScriptCheck should update this value
- 0, // No search proc specified since we're not searching
- 1, // Index of the file path in the 'ist#' resource
- /* [2] */ 1002, noSearchForFile, TypeCrNeedNotMatch, 'ttro', 'ttxt', 0x0, 0x1, 0x1, 0, 2,
- /* [3] */ 2001, noSearchForFile, TypeCrNeedNotMatch, 'ttro', 'ttxt', 0x0, 0x1, 0x1, 0, 3,
- /* [4] */ 3001, noSearchForFile, TypeCrNeedNotMatch, 'ttro', 'ttxt', 0x0, 0x1, 0x1, 0, 4,
- /* [5] */ 3002, noSearchForFile, TypeCrNeedNotMatch, 'ttro', 'ttxt', 0x0, 0x1, 0x1, 0, 5,
- /* [6] */ 1004, noSearchForFile, TypeCrNeedNotMatch, 'ttro', 'ttxt', 0x0, 0x1, 0x1, 0, 6,
- /* [7] */ 1005, noSearchForFile, TypeCrNeedNotMatch, 'ttro', 'ttxt', 0x0, 0x1, 0x1, 0, 7,
- }
- }
- };
-
- resource 'ist#' (300) {
- format0 {
- {
- /* [1] */ ":User Interface Example:Example File • 1",
- /* [2] */ ":User Interface Example:Example File • 2",
- /* [3] */ ":User Interface Example:Example File • 3",
- /* [4] */ ":User Interface Example:Example File • 4",
- /* [5] */ ":User Interface Example:Example File • 5",
- /* [6] */ ":User Interface Example:Example File • 6",
- /* [7] */ ":User Interface Example:Example File • 7",
- }
- }
- };
-
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // • Source File Descriptions
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- // source file spec for Example File #1
- resource 'infs' (1001) {
- 'ttro', // Type for source file
- 'ttxt', // Creator for source file
- 0x1, // Creation date for source file
- noSearchForFile, // ignored
- TypeCrMustMatch, // Type & Creator must match file on source disk
- "Example Files:Example File • 1" // Path to source file
- };
-
- resource 'infs' (1002) { 'ttro', 'ttxt', 0x1, noSearchForFile, TypeCrMustMatch, "Example Files:Example File • 2" };
- resource 'infs' (2001) { 'ttro', 'ttxt', 0x1, noSearchForFile, TypeCrMustMatch, "Example Files:Example File • 3" };
- resource 'infs' (3001) { 'ttro', 'ttxt', 0x1, noSearchForFile, TypeCrMustMatch, "Example Files:Example File • 4" };
- resource 'infs' (3002) { 'ttro', 'ttxt', 0x1, noSearchForFile, TypeCrMustMatch, "Example Files:Example File • 5" };
- resource 'infs' (1004) { 'ttro', 'ttxt', 0x1, noSearchForFile, TypeCrMustMatch, "Example Files:Example File • 6" };
- resource 'infs' (1005) { 'ttro', 'ttxt', 0x1, noSearchForFile, TypeCrMustMatch, "Example Files:Example File • 7" };
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // • Misc Resources
- //
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
- // • Icons for get info window of packages.
-
- resource 'icl8' (9128, purgeable) {
- $"0000 0000 0000 0000 0000 0000 0000 0000"
- $"0000 0000 0000 0000 0000 0000 0000 0000"
- $"0000 0000 0000 0000 0000 0000 0000 0000"
- $"0000 0000 0000 0000 0000 0000 0000 0000"
- $"0000 0000 0000 0000 0000 0000 0000 0000"
- $"0000 0000 0000 0000 0000 0000 0000 0000"
- $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF00"
- $"00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
- $"F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 FF00"
- $"00FF F5FA FAFA FAF5 F500 FFF5 F5F5 F5F5"
- $"F5F5 F5F5 F5F5 F5F5 F5FA FAFA FAF5 FFFF"
- $"00FF F5F5 F5F5 F5F5 F5FF F5F5 FFFF F5FF"
- $"FFFF F5FF FFF5 FFFF F5F5 F5F5 F5F5 FFFF"
- $"00FF F5FA FAFA FAF5 FFF5 FFF5 FFFF F5FF"
- $"F5FF F5FF FFF5 FFFF F5FA FAFA FAF5 FFFF"
- $"00FF F5FA FAFA FAF5 F5F5 F5F5 FFF5 F5F5"
- $"F5F5 F5F5 F5F5 FFF5 F5FA FAFA FAF5 FFFF"
- $"00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
- $"F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 FFFF"
- $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
- $"F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 FFFF"
- $"00FF F5F5 FFFF FFF5 FFF5 F5FF F5FF FFFF"
- $"FFF5 F5FF FFF5 F5F5 FFFF F5F5 FFF5 FFFF"
- $"00FF F5F5 FFF5 F5F5 F5F5 FFF5 F5F5 F5F5"
- $"F5F5 FFF5 F5FF F5FF F5F5 FFF5 FFF5 FFFF"
- $"00FF F5F5 F5F5 F5F5 F5FF F5F5 F5F5 FFF5"
- $"F5F5 F5F5 FFF5 F5FF F5FF FFF5 F5F5 FFFF"
- $"00FF F5F5 FFF5 FFF5 FFF5 F5FF F5F5 FFF5"
- $"F5F5 FFF5 F5FF F5FF F5F5 FFF5 FFF5 FFFF"
- $"00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
- $"F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 FFFF"
- $"00FF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
- $"F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 FFFF"
- $"00FF F5FA FAFA FAFA FAF5 F5FF FFFF FFFF"
- $"FFFF FFFF FFF5 F5FA FAFA FAFA FAF5 FFFF"
- $"00FF F5FA FAFA FAFA FAF5 FF00 FF00 0000"
- $"0000 0000 00FF F5FA FAFA FAFA FAF5 FFFF"
- $"00FF F5F5 F5F5 F5F5 F5F5 FFFF FFFF FFFF"
- $"FFFF FFFF FFFF F5F5 F5F5 F5F5 F5F5 FFFF"
- $"00FF F5FA FAFA FAFA FAF5 FFF9 F9F9 F9F9"
- $"F9F9 F9F9 F9FF F5FA FAFA FAFA FAF5 FFFF"
- $"00FF F5F5 F5F5 F5F5 F5F5 FFF9 F9F9 F9F9"
- $"F9F9 F9F9 F9FF F5F5 F5F5 F5F5 F5F5 FFFF"
- $"00FF F5FA FAFA FAFA FAF5 FFF9 F9F9 F9F9"
- $"F9F9 F9F9 F9FF F5FA FAFA FAFA FAF5 FFFF"
- $"00FF F5F5 F5F5 F5F5 F5F5 FFF9 F9F9 F9F9"
- $"F9F9 F9F9 F9FF F5F5 F5F5 F5F5 F5F5 FFFF"
- $"00FF F5FA FAFA FAFA FAF5 FFF9 F9F9 F9F9"
- $"F9F9 F9F9 F9FF F5FA FAFA FAFA FAF5 FFFF"
- $"00FF F5F5 F5F5 F5F5 F5F5 F5FF FFFF FFFF"
- $"FFFF FFFF FFF5 F5F5 F5F5 F5F5 F5F5 FFFF"
- $"00FF F5FA FAFA FAFA FAF5 F5F5 F5F5 F5F5"
- $"F5F5 F5F5 F5F5 F5FA FAFA FAFA FAF5 FFFF"
- $"00FF F5F5 F5F5 F5F5 F5F5 F5F5 FAFA FAFA"
- $"FAFA FAFA F5F5 F5F5 F5F5 F5F5 F5F5 FFFF"
- $"00FF F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5"
- $"F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5F5 F5FF"
- $"0000 FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
- $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FF"
- };
-
-
- resource 'ICN#' (9128) {
- { /* array: 2 elements */
- /* [1] */
- $"0000 0000 0000 0000 0000 0000 7FFF FFFE"
- $"4000 0002 5E20 007B 404D DB03 5EAD 5B7B"
- $"5E08 027B 4000 0003 7FFF FFFF 4000 0003"
- $"4E97 98CB 4820 252B 4042 0963 4A92 252B"
- $"4000 0003 7FFF FFFF 4000 0003 5F9F F9FB"
- $"5FA8 05FB 403F FC03 5FA0 05FB 4020 0403"
- $"5FA0 05FB 4020 0403 5FA0 05FB 401F F803"
- $"5F80 01FB 400F F003 4000 0001 3FFF FFFE",
- /* [2] */
- $"0000 0000 0000 0000 0000 0000 7FFF FFFE"
- $"7FFF FFFE 7FFF FFFF 7FFF FFFF 7FFF FFFF"
- $"7FFF FFFF 7FFF FFFF 7FFF FFFF 7FFF FFFF"
- $"7FFF FFFF 7FFF FFFF 7FFF FFFF 7FFF FFFF"
- $"7FFF FFFF 7FFF FFFF 7FFF FFFF 7FFF FFFF"
- $"7FFF FFFF 7FFF FFFF 7FFF FFFF 7FFF FFFF"
- $"7FFF FFFF 7FFF FFFF 7FFF FFFF 7FFF FFFF"
- $"7FFF FFFF 7FFF FFFF 7FFF FFFF 3FFF FFFE"
- }
- };
-
-
-